@tailwind base;
@tailwind components;
@tailwind utilities;

/* 移除所有Tab相关的CSS规则 */
*:not([data-selected="true"] *, [aria-selected="true"] *) {
  color: inherit;
}

img {
  user-select: none;
}

.main-bg {
  background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.7) 0%,
      rgba(255, 248, 240, 0.7) 100%
    ),
    url("/main_bkg.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  @apply h-screen w-screen;
}

.main-inner {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 248, 240, 0.6) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  @apply h-screen w-screen;
}

/* 主背景 */
.panel-main-bg {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 165, 0, 0.2);
  border-radius: 0.5rem; /* Equivalent to rounded-lg */
  overflow: hidden;
}

/* 主前景 */
.panel-main-fg {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 165, 0, 0.15);
  border-radius: 8px;
}

/* 标题栏 */
.header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 165, 0, 0.2);
  @apply text-sm flex h-16 px-4 items-center justify-between;
}

/* 常用数据选中 */
:root {
  --data-selected-highlight-color: rgb(255, 255, 255);
  --report-rate-default-border: rgb(51, 51, 51);
  --mouse-content-option-hover: rgba(0, 0, 0, 0.2);
  --mouse-content-option-active: rgba(0, 0, 0, 0.5);
}

.connect-button-container {
  margin-top: 20px;
}

.connect-button {
  position: relative;
  display: inline-block !important;
  padding: 15px 50px !important;
  background-color: transparent !important;
  border-radius: 30px !important;
  width: 260px !important;
  height: 60px !important;
  color: #fff !important;
  font-size: 1.1rem !important;
  font-weight: bold !important;
  text-decoration: none !important;
  text-align: center !important;
  overflow: hidden !important;
  z-index: 1 !important;
  transition: all 0.3s ease !important;
  letter-spacing: 1px !important;
  transform: translateY(-3px) scale(1.05) !important;
  box-shadow: 0 0 15px rgba(121, 40, 202, 0.5), 0 0 30px rgba(255, 150, 0, 0.3) !important;
}

.connect-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgb(255, 140, 0),
    #ff8c00,
    rgb(255, 165, 0),
    #ff6600,
    rgb(255, 140, 0)
  );
  background-size: 200% 200%;
  z-index: -2;
  border-radius: 30px;
  animation: gradient-animation 3s linear infinite;
  opacity: 1;
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
  filter: brightness(1.2) saturate(1.2) !important;
}

.connect-button::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  background-color: rgba(51, 51, 51, 0.8);
  border-radius: 28px;
  z-index: -1;
  transition: all 0.3s ease;
}

.connect-button span {
  position: relative;
  z-index: 3;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  color: #fff;
}

/* 移除悬停样式，因为默认状态已经应用了这些效果 */
.connect-button:hover {
  transform: translateY(-4px) scale(1.08) !important;
}

.connect-button:hover::before {
  filter: brightness(1.3) saturate(1.3) !important;
}

.connect-button:active {
  transform: translateY(-1px) scale(0.98) !important;
}

@keyframes gradient-animation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes button-pulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(121, 40, 202, 0);
  }
  50% {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 0 10px rgba(121, 40, 202, 0.3),
      0 0 20px rgba(85, 81, 255, 0.2);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(121, 40, 202, 0);
  }
}

/* 主按钮 */
.main-btn {
  background: linear-gradient(
    135deg,
    rgb(255, 140, 0) 0%,
    rgb(255, 165, 0) 100%
  ) !important;
  color: white !important;
  border-radius: 8px !important;
  padding: 0 12px !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 165, 0, 0.3) !important;
  transition: all 0.3s ease !important;
}
.main-btn:hover {
  background: linear-gradient(
    135deg,
    rgb(255, 120, 0) 0%,
    rgb(255, 145, 0) 100%
  ) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3) !important;
}

/* 下拉菜单按钮 */
.selecet-menu-btn {
  background: rgba(255, 255, 255, 0.6) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 165, 0, 0.2) !important;
  color: #050505 !important;
  transition: all 0.3s ease !important;
  &:hover {
    background: rgba(255, 165, 0, 0.1) !important;
    border-color: rgba(255, 165, 0, 0.3) !important;
    box-shadow: 0 0 2px 0 rgba(255, 165, 0, 0.48) !important;
  }
}

/* 下拉菜单选项 */
.select-menu-item {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: #050505 !important;
  transition: all 0.3s ease !important;
}
.select-menu-item:hover {
  background: rgba(255, 165, 0, 0.1) !important;
  color: rgb(255, 140, 0) !important;
}

.select-menu-item-light {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: #050505 !important;
  transition: all 0.3s ease !important;
}
.select-menu-item-light:hover {
  background: rgba(255, 165, 0, 0.1) !important;
  color: rgb(255, 140, 0) !important;
}

/* 按键功能 */
.keytabs-list {
  max-height: 560px !important;
  overflow: auto !important;
  li {
    color: #050505 !important;
    padding-left: 24px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    transition: all 0.3s ease !important;
    &.keys-type {
      color: #050505 !important;
      font-weight: 500 !important;
      font-size: 18px !important;
      padding-left: 12px !important;
      &:hover {
        background: transparent !important;
      }
    }
    &[data-selected="true"] {
      background: linear-gradient(
        135deg,
        rgb(255, 140, 0) 0%,
        rgb(255, 165, 0) 100%
      ) !important;
      color: white !important;
      cursor: pointer !important;
      border-radius: 8px !important;
    }
    &:hover {
      background: linear-gradient(
        135deg,
        rgb(255, 140, 0) 0%,
        rgb(255, 165, 0) 100%
      ) !important;
      color: white !important;
      cursor: pointer !important;
      border-radius: 8px !important;
    }
  }
}

/* Home Macro Settings用到的一些Box样式 */
.box-wrapper {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 165, 0, 0.15);
  border-radius: 8px;
  padding: 8px 40px;
  font-size: 18px;
  font-weight: 700;
  justify-content: space-between;
  transition: all 0.3s ease;
}
.box-wrapper:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 165, 0, 0.25);
  box-shadow: 0 4px 12px rgba(255, 165, 0, 0.1);
}
.box-wrapper-light {
  background-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  @apply flex p-4 w-80 h-28 text-sm border border-orange-500/40 justify-between text-black;
}
.box-wrapper-light-100 {
  @apply bg-white;
}

/* DPI档位 */
.dpi-list {
  display: flex;
  flex-direction: row;
  gap: 1.5rem; /* Adjust the gap as needed */

  > div {
    @apply w-32 rounded-md relative overflow-hidden;
    box-sizing: border-box; /* Ensures padding and border are included in width */
  }
}

body {
  color: #000 !important;
  background: rgb(242, 243, 247) !important;

  ::-webkit-scrollbar {
    width: 6px;
  }
  ::-webkit-scrollbar-track {
    background: #e8e8e8;
  }
  ::-webkit-scrollbar-thumb {
    background: #bbbbbb;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #999999;
  }
}

@layer utilities {
  .text-balance {
    text-wrap: balance;
  }
}

.tabs {
  @apply pl-10 pr-5 w-40 min-w-40;
  .tablist {
    @apply !flex !flex-col gap-0.5 rounded-md overflow-hidden;
    background-color: rgb(255, 255, 255, 0.3);
    button {
      @apply h-20 border-none !mb-0 text-black;
      svg {
        @apply fill-black;
      }
      &:hover {
        @apply bg-gray-100;
        svg {
          @apply fill-black;
        }
      }
      &:active {
        @apply bg-white;
        color: rgb(59, 130, 246) !important;
        svg {
          @apply fill-blue-500;
        }
      }
      &[aria-selected="true"] {
        @apply bg-white border-l-4 border-l-blue-500;
        color: rgb(59, 130, 246) !important;
        svg {
          @apply !fill-blue-500;
        }
      }
      &:focus {
        @apply bg-gray-100;
        color: black !important;
        svg {
          @apply fill-black;
        }
      }
    }
  }
  .indicator {
    @apply !h-20 !w-20;
  }
}

.mouse-edit-list {
  li {
    @apply grid grid-cols-2 h-12 items-center relative select-none;
    div:first-child {
      @apply pl-7;
    }
    &:hover {
      background: rgba(255, 165, 0, 0.7) !important;
      color: white !important;
      cursor: pointer !important;
    }
  }
  li[aria-selected="true"] {
    background: linear-gradient(
      135deg,
      rgb(255, 140, 0) 0%,
      rgb(255, 165, 0) 100%
    ) !important;
    color: white !important;
    &::before {
      content: "";
      background: #ffffff;
      @apply absolute left-0 w-1 rounded-full h-11;
    }
  }
}

.mouse-key-edit-list {
  @apply py-2 gap-2 max-h-[calc(100vh-10rem)] overflow-auto flex flex-col;
  li {
    > div {
      border-image: linear-gradient(
          to bottom,
          rgb(255, 140, 0),
          rgb(255, 165, 0)
        )
        1;
      background: rgba(255, 255, 255, 0.8) !important;
      backdrop-filter: blur(10px) !important;
      -webkit-backdrop-filter: blur(10px) !important;
      @apply p-3 text-black border border-orange-500/40;
      > div {
        @apply mb-2;
      }
    }
    &[data-selected="true"] > div {
      background: linear-gradient(
        135deg,
        rgb(255, 140, 0) 0%,
        rgb(255, 165, 0) 100%
      ) !important;
      color: white !important;
    }
  }
}

.mouse-mode {
  .mouse-key {
    @apply absolute w-[80px] h-[32px] leading-8 text-center border-2 border-blue-500 bg-white text-black shadow-md hover:cursor-pointer select-none rounded shadow;
    &[data-selected="true"] {
      @apply !bg-blue-500 !text-white;
      * {
        @apply !text-white;
      }
    }
    &::before {
      content: "";
      @apply absolute top-[0.85rem] h-[1px] border-b border-blue-500;
    }
    &::after {
      content: "";
      @apply absolute top-[0.67rem] h-2 w-2 rounded-full border-2 border-blue-500;
    }
  }
  .key0 {
    @apply top-[3.0rem] left-0;
    &::before {
      @apply left-[5rem] w-32;
    }
    &::after {
      @apply left-[12.8rem];
    }
  }
  .key1 {
    @apply top-[3.0rem] right-0;
    &::before {
      @apply -left-[8rem] w-32;
    }
    &::after {
      @apply -left-[8.5rem];
    }
  }
  .key2 {
    @apply top-[7rem] right-0;
    &::before {
      @apply -left-[10.7rem] w-[10.4rem];
    }
    &::after {
      @apply -left-[10.9rem];
    }
  }
  .key3 {
    @apply top-[16rem] left-0;
    &::before {
      @apply left-[5rem] w-[4rem];
    }
    &::after {
      @apply left-[8.8rem];
    }
  }
  .key4 {
    @apply top-[12rem] left-0;
    &::before {
      @apply left-[5rem] w-[3.8rem];
    }
    &::after {
      @apply left-[8.8rem];
    }
  }

  .key5 {
    @apply top-[16.5rem] right-0;
    &::before {
      @apply -left-[8.5rem] w-[8.5rem];
    }
    &::after {
      @apply -left-[8.8rem];
    }
  }
}

.mouse-a5_ultra {
  .key0 {
    @apply top-[4.5rem] left-0;
    &::before {
      @apply left-[5rem] w-32;
    }
    &::after {
      @apply left-[12.8rem];
    }
  }
  .key1 {
    @apply top-[4.5rem] right-0;
    &::before {
      @apply -left-[8rem] w-32;
    }
    &::after {
      @apply -left-[8.5rem];
    }
  }
  .key2 {
    @apply top-[7.5rem] right-0;
    &::before {
      @apply -left-[10.4rem] w-[10.4rem];
    }
    &::after {
      @apply -left-[10.9rem];
    }
  }
  .key3 {
    @apply top-[11rem] left-0;
    &::before {
      @apply left-[5rem] w-16;
    }
    &::after {
      @apply left-[8.8rem];
    }
  }
  .key4 {
    @apply top-[15rem] left-0;
    &::before {
      @apply left-[5rem] w-[4rem];
    }
    &::after {
      @apply left-[8.8rem];
    }
  }
}

.mouse-ax5_promax {
  .key0 {
    @apply top-[4.2rem] left-0;
    &::before {
      @apply left-[5rem] w-32;
    }
    &::after {
      @apply left-[12.8rem];
    }
  }
  .key1 {
    @apply top-[4.2rem] right-0;
    &::before {
      @apply -left-[8rem] w-32;
    }
    &::after {
      @apply -left-[8.5rem];
    }
  }
  .key2 {
    @apply top-[7.2rem] right-0;
    &::before {
      @apply -left-[10.25rem] w-[10.25rem];
    }
    &::after {
      @apply -left-[10.75rem];
    }
  }
  .key3 {
    @apply top-[11rem] left-0;
    &::before {
      @apply left-[5rem] w-16;
    }
    &::after {
      @apply left-[8.8rem];
    }
  }
  .key4 {
    @apply top-[15rem] left-0;
    &::before {
      @apply left-[5rem] w-[4rem];
    }
    &::after {
      @apply left-[8.8rem];
    }
  }
}

.mouse-g3_mouse_4k,
.mouse-g3_mouse_8k {
  .key0 {
    @apply top-[4.5rem] left-0;
    &::before {
      @apply left-[5rem] w-32;
    }
    &::after {
      @apply left-[12.8rem];
    }
  }
  .key1 {
    @apply top-[7.5rem] right-0;
    &::before {
      @apply -left-[10.3rem] w-[10.3rem];
    }
    &::after {
      @apply -left-[10.8rem];
    }
  }
  .key2 {
    @apply top-[4.5rem] right-0;
    &::before {
      @apply -left-[8rem] w-32;
    }
    &::after {
      @apply -left-[8.5rem];
    }
  }

  .key3 {
    @apply top-[11rem] left-0;
    &::before {
      @apply left-[5rem] w-16;
    }
    &::after {
      @apply left-[8.8rem];
    }
  }
  .key4 {
    @apply top-[15rem] left-0;
    &::before {
      @apply left-[5rem] w-[4rem];
    }
    &::after {
      @apply left-[8.8rem];
    }
  }
}

.reply-list {
  div {
    @apply text-right bg-white text-black rounded px-2 py-1.5 relative w-28 border border-blue-500/20;
    &:hover {
      @apply bg-gray-100 transition-transform cursor-pointer;
    }
    &[data-selected="true"] {
      @apply bg-blue-500 text-white transition-transform cursor-pointer shadow;
    }
    &::before {
      content: "";
      @apply absolute left-0 top-0 h-full w-6 rounded-l;
    }
    &:nth-child(1)::before {
      @apply bg-fuchsia-600;
    }
    &:nth-child(2)::before {
      @apply bg-lime-600;
    }
    &:nth-child(3)::before {
      @apply bg-amber-600;
    }
  }
}

.chakra-radio:hover {
  .chakra-radio__control {
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.465);
    padding: 1px;
  }
}

/* 增强Radio未选中状态的可见度 */
.chakra-radio .chakra-radio__control {
  background-color: rgba(255, 255, 255, 0.6) !important;
  border: 2px solid rgba(0, 0, 0, 0.5) !important;
  transition: all 0.2s ease;
  width: 16px;
  height: 16px;
}

.chakra-radio .chakra-radio__control[data-checked] {
  background-color: rgb(59, 130, 246) !important;
  border-color: rgb(59, 130, 246) !important;
}

.chakra-radio .chakra-radio__control::before {
  width: 8px !important;
  height: 8px !important;
  background-color: white !important;
}

.chakra-radio .chakra-radio__label {
  font-weight: 500;
  color: #000000;
}

.chakra-checkbox:hover {
  .chakra-checkbox__control {
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.465);
    padding: 1px;
  }
}

/* 增强Checkbox未选中状态的可见度 */
.chakra-checkbox .chakra-checkbox__control {
  background-color: rgba(255, 255, 255, 0.6) !important;
  border: 2px solid rgba(0, 0, 0, 0.5) !important;
  transition: all 0.2s ease;
  width: 16px;
  height: 16px;
}

.chakra-checkbox .chakra-checkbox__control[data-checked] {
  background-color: rgb(59, 130, 246) !important;
  border-color: rgb(59, 130, 246) !important;
}

.chakra-checkbox .chakra-checkbox__label {
  font-weight: 500;
  color: #000000;
}

.chakra-slider:hover {
  .chakra-slider__thumb {
    top: 0px;
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.465);
    animation: scale 1.3s ease-in infinite;
  }
}

@keyframes scale {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.new-btn {
  @apply relative !bg-gray-700/30 !rounded-full !text-white;
  &:hover {
    @apply !bg-gray-600/30;
  }
  &::before {
    content: "";
    @apply !bg-gray-500/60 absolute rounded-full p-[1px];
    inset: 0;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
  }

  &:hover::before {
    background: linear-gradient(
      125deg,
      rgba(59, 130, 246, 1) 0%,
      rgba(59, 130, 246, 1) 29%,
      rgba(59, 130, 246, 1) 62%,
      rgba(59, 130, 246, 1) 100%
    );
  }
}

.macro-list {
  li {
    @apply py-2 px-4 rounded;
    &[data-selected="true"] {
      @apply bg-blue-500 text-white;
    }
  }
}

.macro-action-list {
  li {
    @apply grid grid-cols-[30%_30%_25%_15%] items-center justify-items-center;
    &:not(:first-child) {
      @apply bg-gray-100 py-1 hover:bg-gray-200 hover:cursor-pointer;
    }
    &[data-selected="true"] {
      @apply bg-blue-500 text-white;
    }
  }
  input {
    @apply pr-4 h-8;
  }
  input:focus {
    @apply shadow-none border-none outline-0;
  }
}

.beta::after {
  content: "Beta";
  @apply absolute -right-4 -top-8 rounded px-2 py-0 bg-red-500 text-white font-bold text-xl;
}

.wave-area {
  @apply relative overflow-hidden h-[100px];
  .wave {
    background: url("/wave.svg") repeat-x;
    animation: wave 35s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
    transform: translate3d(0, 0, 0);
    @apply absolute w-[6400px] h-[100px] z-10;
    &:nth-of-type(2) {
      top: 20px;
      animation: wave 20s cubic-bezier(0.36, 0.45, 0.63, 0.53) -0.125s infinite;
      opacity: 1;
      z-index: 1;
    }
  }
}

@keyframes wave {
  0% {
    margin-left: 0;
  }
  100% {
    margin-left: -1600px;
  }
}

.link-status {
  h3[data-status="active"] {
    @apply text-blue-500;
  }
  h3[data-status="complete"] {
    @apply text-blue-500;
  }

  h3[data-status="incomplete"] {
    @apply text-gray-500;
  }

  .chakra-step__separator {
    &[data-status="incomplete"] {
      @apply bg-gray-500;
    }
    &[data-status="active"] {
      @apply bg-gray-500;
    }
  }

  .chakra-step__indicator {
    &[data-status="incomplete"] {
      @apply border-gray-500;
    }
  }
}

.rotate {
  @apply hover:cursor-pointer hover:rotate-180 ease-out transition-all duration-[2000];
}

.product-card {
  @apply p-6 hover:shadow-gray-700 hover:bg-gray-600/30 hover:cursor-pointer text-stone-100 hover:text-gray-50;

  background-color: rgba(255, 255, 255, 0.16);

  &:hover {
    box-shadow: inset 0 0 16px 0 rgb(59, 130, 246);
  }
}

.primary-btn {
  @apply !bg-blue-500 text-white !rounded-none !text-sm !px-3 !h-6;
}

.normal-btn {
  @apply !bg-[#FFB65252] text-center !rounded-none !text-sm !px-3 !h-8;
}

.border-gradient {
  @apply border;
  border-image: linear-gradient(to bottom, rgb(59, 130, 246), #2563eb) 1;
}

/* 响应式调整 */
@media screen and (max-width: 1200px) {
  .key-tabs {
    .chakra-tabs__tab-panels {
      max-height: 50vh;
    }
  }

  .keytabs-list {
    @apply max-h-[400px];
    li {
      @apply py-1.5;
      &.keys-type {
        @apply text-base sticky top-0 bg-white z-10;
      }
    }
  }

  .mouse-container {
    transform: translate(-50%, 5%) scale(0.9) !important;
  }
}

@media screen and (max-width: 992px) {
  .key-tabs-container {
    right: 2% !important;
    top: 70px !important;
    max-width: 95% !important;
  }

  .mouse-container {
    transform: translate(-50%, 5%) scale(0.85) !important;
  }

  .key-tabs {
    .chakra-tabs__tab-panels {
      max-height: 45vh;
    }
  }
}

@media screen and (max-width: 768px) {
  .key-tabs-container {
    position: fixed !important;
    bottom: 10px !important;
    top: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: 95%;
  }

  .mouse-container {
    top: 50px !important;
    transform: translate(-50%, 0%) scale(0.8) !important;
  }

  .key-tabs {
    .chakra-tabs__tab-panels {
      max-height: 35vh;
    }
  }

  .keytabs-list {
    @apply max-h-[300px];
    li {
      @apply py-1;
      &.keys-type {
        @apply text-sm;
      }
    }
  }
}

.w-color-swatch {
  > div {
    @apply border border-transparent hover:border-gray-100;
  }
}

.commbo-keys {
  @apply flex justify-center gap-4 items-center flex-wrap;
  .commbo-key {
    @apply p-4 border border-blue-500 bg-white text-black rounded-lg hover:cursor-pointer;
    &[data-selected="true"] {
      @apply bg-blue-500 text-white border-blue-500;
    }
  }
  .input-key {
    @apply border border-blue-500 h-12 px-2 w-16 text-xl bg-white text-black;
  }
}

.keyinput-box {
  @apply bg-white border-blue-500 border-2 text-black !text-xl font-medium text-center px-0.5;
  &:focus {
    @apply bg-white border-2 border-blue-500 outline-none shadow-sm;
  }
}

@media screen and (max-width: 992px) {
  .commbo-keys {
    @apply gap-2;
    .commbo-key {
      @apply p-3 text-sm;
    }
  }
}

@media screen and (max-width: 768px) {
  .commbo-keys {
    @apply gap-1;
    .commbo-key {
      @apply p-2 text-xs;
    }
  }
}

/* MouseEdit相关样式 */
.mouse-edit-container {
  overflow: hidden;
}

.key-tabs-wrapper {
  width: 100%;
  position: relative;
}

/* 优化TabPanel内容在小屏幕上的显示 */
@media screen and (max-width: 768px) {
  .key-tabs .chakra-tabs__tab-panel {
    padding: 0.5rem !important;
  }

  /* 优化宏面板布局 */
  .key-tabs .chakra-tabs__tab-panel:last-child .space-y-4 {
    @apply space-y-2 px-4 !important;
  }

  /* 优化组合键面板 */
  .key-tabs .chakra-tabs__tab-panel:nth-child(2) .rounded-lg {
    @apply p-2 !important;
  }
}

.mouse-content-option {
  &:hover {
    background-color: var(--mouse-content-option-hover) !important;
  }
  &:active {
    background-color: var(--mouse-content-option-active) !important;
  }
}

/* keyboard style start */
.keyboard {
  position: relative;
}

.keycap {
  @apply relative rounded-lg transition-all duration-300;
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Fn层特殊样式 */
.keycap[data-fn="true"] {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.2);
}

.keycap[data-fn="true"]:hover {
  background-color: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.3);
}

.keycap[data-fn="true"][data-active="true"] {
  background-color: rgba(239, 68, 68, 0.8);
  border-color: rgba(239, 68, 68, 0.9);
  color: white;
}

.keycap[data-fn="true"][data-active="true"] .key-content {
  color: white;
  font-weight: 600;
}

.keycap:hover {
  @apply cursor-pointer;
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 165, 0, 0.3);
  box-shadow: 0 4px 8px rgba(255, 165, 0, 0.1);
  transform: translateY(-1px);
}

.keycap:hover .advanced-key {
  display: flex;
}

.keycap:hover .key-color {
  background-color: rgba(255, 165, 0, 0.1);
  border-color: rgba(255, 165, 0, 0.3);
}

.keycap:hover .keycap-bg {
  border-color: rgba(255, 165, 0, 0.3);
}

.key-wrapper[aria-selected="true"] .keycap-bg {
  background: rgba(255, 165, 0, 0.2) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

.key-wrapper[aria-selected="true"] .key-content {
  color: rgb(255, 140, 0) !important;
  font-weight: 500 !important;
}

/* Fn层选中状态 */
.key-wrapper[data-fn="true"][aria-selected="true"] .keycap-bg {
  @apply bg-red-500/20 backdrop-blur-sm;
}

.key-wrapper[data-fn="true"][aria-selected="true"] .key-content {
  @apply text-red-500 font-medium;
}

.keycap-bg {
  border-radius: 0.5rem;
  @apply h-full w-full relative border border-transparent transition-all duration-300;
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(1px);
}

/* Fn层背景 */
.keycap-bg[data-fn="true"] {
  background-color: rgba(239, 68, 68, 0.1);
}

.keycap-bg[data-fn="true"][data-active="true"] {
  background-color: rgba(239, 68, 68, 0.8);
}

.key-content {
  font-size: 12px;
  font-weight: 500;
  border-radius: 0.5rem;
  @apply text-gray-700/90 w-full whitespace-pre-wrap transition-colors duration-300;
}

/* Fn层文字 */
.key-content[data-fn="true"] {
  color: rgba(239, 68, 68, 0.9);
}

.key-content[data-fn="true"][data-active="true"] {
  color: white;
  font-weight: 600;
}

.remap-key {
  word-break: break-word;
  font-weight: 500;
  color: rgba(55, 65, 81, 0.9);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(209, 213, 219, 0.3);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  line-height: 1;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.remap-key:hover {
  border-color: rgba(255, 165, 0, 0.4);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(255, 165, 0, 0.1);
}

.remap-key-dks {
  word-break: break-word;
  font-weight: 500;
  color: rgba(55, 65, 81, 0.9);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(209, 213, 219, 0.3);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  line-height: 1;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.remap-key-dks:hover {
  border-color: rgba(255, 165, 0, 0.4);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(255, 165, 0, 0.1);
}

.remap-key-used::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  border-top: 12px solid rgba(255, 165, 0, 0.6);
  border-left: 12px solid transparent;
  border-radius: 0 8px 0 0;
}
/* keyboard style end */

/* keyboard & full keyboard style start */
/* .full-keyboard {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  
  .full-keyboard-bg-inner-wrapper {
    --var-key-width: 1rem;
    --var-key-height: 1rem;
    --var-key-left: 1;
    --var-key-top: 1;
    --var-key-translateZ: 0;
  }

  .full-keycap {
    @apply w-full h-full text-center text-black-1 font-bold border border-black-1 rounded;
    font-size: 10px;
    line-height: calc(var(--var-key-scale)*var(--var-key-height) - 4px);
  }
  
  .full-keycap:hover {
    @apply text-blue-1 border border-blue-1 cursor-pointer;
  }
} */
.full-keyboard {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  margin: 0 auto;

  .full-keyboard-bg-inner-wrapper {
    --var-key-width: 1rem;
    --var-key-height: 1rem;
    --var-key-left: 1;
    --var-key-top: 1;
    --var-key-translateZ: 0;
  }

  .full-keycap {
    width: 100%;
    height: 100%;
    text-align: center;
    font-weight: bold;
    border-radius: 0.25rem;
    color: var(--key-text-color);
    font-size: 10px;
    line-height: calc(var(--var-key-scale) * var(--var-key-height) - 4px);
  }

  .full-keycap:hover {
    color: var(--key-hover-text-color);
    cursor: pointer;
  }

  /* 明主题 */
  :root {
    --key-border-color: #151515;
    --key-text-color: #151515;
    --key-hover-text-color: #1e90ff;
    --key-hover-border-color: #1e90ff;
  }

  /* 暗主题 */
  [data-theme="dark"] {
    --key-border-color: #f5f5f5;
    --key-text-color: #f5f5f5;
    --key-hover-text-color: #90caf9;
    --key-hover-border-color: #90caf9;
  }
}

.matrix-renderer {
  font-family: monospace;
  color: white;
}
.controls {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}
.start-btn,
.stop-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}
.start-btn {
  background-color: #10b981;
  color: white;
}
.start-btn:disabled {
  background-color: #6b7280;
  cursor: not-allowed;
}
.stop-btn {
  background-color: #ef4444;
  color: white;
}
.stop-btn:disabled {
  background-color: #6b7280;
  cursor: not-allowed;
}
.status {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  min-width: 200px;
  text-align: center;
}
.sliders {
  display: flex;
  gap: 20px;
}
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.slider-group label {
  font-size: 12px;
  /* color: #d1d5db; */
}
.gain-slider,
.max-db-slider {
  width: 200px;
}
.matrix-grid {
  border: 1px solid #374151;
  border-radius: 8px;
}
.cell {
  background-color: #374151;
  border-radius: 2px;
  transition: background-color 0.1s ease;
}
.cell.on {
  background-color: red;
}
